<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Visualizar Produto</title>
        <link rel="stylesheet" type="text/css" href="Css/Geral.css" />
    </h:head>
    <h:body>
        <h:form>
            <h:panelGrid columns="2" columnClasses="col80">
                <h:commandButton id="btnCancelar" value="Cancelar" action="index" immediate="true" actionListener="#{produtoBean.limpar}"
                                 title="Cancelar" image="Imagens/Cancel.png" styleClass="ico" />
                <h:commandButton id="btnAdicionarOutro" value="Adicionar Outro" action="cadastroProduto" actionListener="#{produtoBean.limpar}"
                                 title="Adicionar Outro" image="Imagens/Add.png" styleClass="ico" />
            </h:panelGrid>

            <h:panelGrid>
                <p:dataTable id="tblProduto" value="#{produtoBean.produtoList}" var="p" rows="10" emptyMessage="sem registros" paginator="true">
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Nome" />
                        </f:facet>
                        <h:outputText value="#{p.nome}" />
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Data entrada" />
                        </f:facet>
                        <h:outputText value="#{p.dataEntrada}">
                            <f:converter converterId="converteData" />
                        </h:outputText>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Tipo" />
                        </f:facet>
                        <h:outputText value="#{p.tipo}">                            
                            <f:converter converterId="converteTipo" />
                        </h:outputText>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Quantidade" />
                        </f:facet>
                        <h:outputText value="#{p.quantidade}" />
                    </p:column>
                </p:dataTable>
            </h:panelGrid>     
        </h:form>
    </h:body>
</html>

